<template name="titleBox">
	<view class="p_title" >
		<view class="" v-for="(item, index) in publictitle" :key="index">
			<text class="p_title_left"><text class="iconfont" :class="item.titleIcon"></text>{{item.title}}</text>
			<text @click="more()" class="p_more">{{item.mores}}</text>
		</view>
	</view>
</template>

<script>
export default{
	name:"titleBox",
	props:{
		publictitle:{
			title:{
				type: String,
				default: ''
			},
			titleIcon:{
				type: String,
				default: ''
			},
			mores:{
				type: String,
				default: ''
			}	
		}
	},
	data(){
		return{
			
		}
	},
	methods:{
		more() {
			console.log('我是子组件')
			this.$emit('moreBtn') //(父组件中触发的事件名，要传的变量名)
		}
	}
}		
</script>

<style lang="scss">
@import "../../icon/iconfont.css";
.p_title{
	font-size: $uni-font-size-lg;
	color: $uni-color-error;
	padding-bottom:$uni-spacing-row-base;
	.p_title_left{
		width: 70%;
		display: inline-block;
		font-weight: bold;
		letter-spacing: $uni-spacing-row-one;
		.iconfont{
			font-size: $uni-font-size-lgx;
			padding-right: $uni-border-radius-base;
		}
	}
	.p_more{
		font-size: $uni-font-size-sm;
		color: $uni-text-color-placeholder;
		width: 30%;
		display: inline-block;
		text-align: right;
		font-weight: normal;
	}
}
</style>
